package com.carpedil.shirodemo.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.carpedil.shirodemo.system.model.User;

import java.util.Set;

/**
 * 用户表 服务类
 *
 * @author carpedil
 * @since 2021-01-05
 */
public interface IUserService extends IService<User> {
  Set<String> selectRoleNameByUserName(String username);

  Set<String> selectPermsByUserName(String username);
  /**
   * 获取用户所拥有的操作权限
   *
   * @param username 登录用户名
   * @return 该用户拥有操作权限的Set集合
   */
  Set<String> selectOperatorPermsByUserName(String username);

  User selectUserByUserName(String username);

  IPage<User> selectAllWithDept(Integer page, Integer limit, User userQuery);

  boolean save(User user, Integer[] roleIds);

  boolean updateUser(User user, Integer[] roleIds);

  boolean enable(Integer userId);

  boolean disable(Integer userId);

  boolean deleteUserById(Integer id);
}
